package com.bkhc.business.api;

import com.bkhc.business.entity.Customer;
import com.bkhc.business.service.CustomerService;
import com.bkhc.business.service.OrderService;
import com.bkhc.common.annotation.ApiOperation;
import com.bkhc.common.annotation.ApiPackage;
import com.bkhc.common.annotation.AuditLog;
import com.bkhc.common.annotation.WebRestController;
import com.bkhc.common.enu.OperationEnum;
import com.bkhc.common.util.response.PageUtil;
import com.bkhc.common.util.response.ResultJson;
import com.bkhc.common.vo.OrderVo;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * @author pcq
 * @date 2021/6/20 17:57
 */
@WebRestController
@Api("客户管理服务")
@RequestMapping("/")
@ApiPackage(code="order-api",name="客户订单管理服务",description = "客户订单管理服务操作接口")
public class OrderController  {
    @Autowired
    private OrderService orderService;
    @ApiOperation(code="queryOrderByUserId",name="登陆用户查询订单",description = "登陆用户查询订单",type = "common")
    @AuditLog(object="Order",operation = "查询订单",type = OperationEnum.query)
    @RequestMapping(path = "/queryOrderByUserId",method = RequestMethod.POST)
    public PageUtil getOrdersByBussiness(@RequestBody OrderVo order,
                                       @RequestParam(name="pageIndex") int pageIndex,
                                       @RequestParam(name="pageSize") int pageSize) {
        PageUtil res = orderService.getOrdersByBussiness(order,pageIndex, pageSize);
        return res;
    }
}
